import { MongooseFactory } from '../kalend';
import { Schema } from 'mongoose';


const LogSchema = MongooseFactory.Schema({
    //应用名称 如：server  governor
    applicationName: {
        type: String
    },
    //异常类型  如：exception info error debug
    type: {
        type: String,
        enum: ['exception', 'info', 'error', 'debug', null],
        default: "exception"
    },
    module: String,
    title: {
        type: String
    },
    detail: {
        type: Schema.Types.Mixed
    },
    success:{
        type: Boolean,
        default: false
    },
    time: {
        type: Date,
        default: new Date()
    }
});

export const LogModel = MongooseFactory.Model("log", LogSchema);